package com.zhuchaooasystem.adapter.holder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.zhuchaooasystem.R;
import com.zhuchaooasystem.entity.ServiceMessageEntity;
import com.zhuchaooasystem.utils.CalendarUtils;

/**
 * @author yinsi
 */
public class ServiceMessageReadHolder extends BaseViewHolder<ServiceMessageEntity.ResultBean.SuccessfulBean.ResopnseMegBean> {
    //----
    private TextView tv_state;
    private TextView tv_time;
    private TextView tv_detail;
    private TextView tv_code;
    private TextView tv_name;
    private TextView tv_reservation;
    private TextView tv_address;

    public ServiceMessageReadHolder(ViewGroup parent) {
        super(parent, R.layout.item_recycleview_service_message_read);
        //----
        tv_state = $(R.id.item_recyclecview_service_message_state);
        tv_time = $(R.id.item_recyclecview_service_message_time);
        tv_detail = $(R.id.item_recyclecview_service_message_detail);
        tv_code = $(R.id.item_recyclecview_service_message_code);
        tv_name = $(R.id.item_recyclecview_service_message_contact_name);
        tv_reservation = $(R.id.item_recyclecview_service_message_reservation);
        tv_address = $(R.id.item_recyclecview_service_message_address);
    }

    @Override
    public void setData(final ServiceMessageEntity.ResultBean.SuccessfulBean.ResopnseMegBean message) {

        tv_state.setText(message.getServiceStatus());
        tv_time.setText(message.getServiceTime());
        tv_detail.setText(message.getServiceName());
        tv_code.setText(message.getProjectId() + "");
        tv_name.setText(message.getUserName());
        tv_reservation.setText(CalendarUtils.formatSysMills(message.getReservation()));
        tv_address.setText(message.getAddress());
    }

}
